﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package reprise.utils {
    import reprise.ui.*;
    import flash.display.*;

    public final class DisplayListUtil {

        public static function locateElementContainingDisplayObject(_arg1:DisplayObject, _arg2:Boolean=false):UIObject{
            var _local3:DisplayObject = _arg1;
            while (((_local3) && (!((_local3 is UIObject))))) {
                _local3 = _local3.parent;
            };
            if (((!(_local3)) || (!(_arg2)))){
                return ((_local3 as UIObject));
            };
            var _local4:UIObject = UIObject(_local3);
            while (((_local4) && (!(_local4.canBecomeKeyView())))) {
                _local4 = _local4.parentElement();
            };
            return (_local4);
        }

    }
}//package reprise.utils 
